{$header}
<div id="main" class="main" >
    <div class="content">
  <h3 class="heading">新增销售订单 [ <a href="__URL__">返回列表</a> ] </h3>
<div id="result" class="result none"></div>
<form class="form-horizontal well" method='post' id="form1" name="form1" action="__URL__/insert/">
<table cellpadding=3 cellspacing=3 >
<tr>
    <td class="tRight" width="150px">PO号：</td>
	<td class="tLeft" >
             <input type="text" name="po" value="">
            
        </td>
</tr>
<tr>
    <td class="tRight">客户：</td>
        <td class="tLeft">
         <div class="input-append">
                <input id="cq" name="cq" class="input-xlarge search-query" placeholder="搜索"><input id="hz" name="customer_id" type="hidden"></input>
                <button class="btn" type="button" onclick="filterCustomer()"><i class="icon-search"></i>搜索</button>
            </div>
        </td>
</tr>
<tr>
    <td class="tRight">发货地址：</td>
        <td class="tLeft"><textarea class="span12" name="address" rows="1"></textarea>
        </td>
</tr>
<tr>
    <td class="tRight">订单要求：</td>
        <td class="tLeft"><textarea class="span12" name="remark" rows="3"></textarea>
        </td>
</tr>
<tr>
    <td class="tRight" width="150px">按<b>CAS</b>快速查询：</td>
	<td class="tLeft" >
            <input id="ptm" name="ptm_id" style="width:700px">
            <br/><a class="btn btn-primary" href="javascript:void(0)" onclick="showdetail('ptm','sale');">添加产品</a>
        </td>
</tr>
<tr>
    <td class="tRight" >按<b>中英名称或CAS</b>查询产品：</td>
    <td class="tLeft" >
            <div class="input-append">
                <input id="q" name="q" class="input-xlarge search-query" placeholder="搜索"><input id="hz" name="hz_id" type="hidden">
                <button class="btn" type="button" onclick="search()"><i class="icon-search"></i>搜索</button>
                <span class="help-inline alert">支持空格查询</span>
            </div>
            <br/><a class="btn btn-primary" href="javascript:void(0)" onclick="showdetail('hz','sale');">添加产品</a>
        </td>
</tr>
<tr>
	<td class="tRight">选择的产品：</td>
        <td class="tLeft">
            <table id="chosed_product" class="table table-bordered table-striped">
                <thead><tr><th>名称</th><th>单价</th><th>数量</th><th>单位</th><th>库存</th><th>规格</th><th>要求交货期</th><th>备注</th><th>状态</th><th>删除</th></tr></thead>
            </table>
        </td>
</tr>
<tr>
    <td>销售总成本</td>
    <td>
        <input type="text" name="cost" class="span2" >人民币 
        <input type="checkbox" name="invoice" class="offset1">开票
    </td>
</tr>
<tr>
    <td>客户预付款</td>
    <td>
        <input type="text" name="prepay">
        <strong>客户余款：</strong>  <input type="text" name="remain_money">{:configList(C('currency'),'','currency')}
    </td>
</tr>
<tr>
	<td class="tRight" >经办人：</td>
	<td class="tLeft" >
            <select name="user_id">
                <volist name="users" id="us">
                <option value="{$key}" <eq name="_SESSION[C('USER_AUTH_KEY')]" value="$key">selected</eq> >{$us}</option>
                </volist>
            </select>
            销售时间：<input type="text" class="span2" name="create_time" value="{:toDate(time())}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
            状态：<input type="hidden" name="status" value="1"> 新订单
        </td>
</tr>

<tr>
	<td></td>
	<td class="center" width="300">
	<button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> 保存</button>
	<a class="btn btn-primary offset1" href="__URL__"><i class="icon-arrow-left icon-white"></i>返回</a>
	</td>
</tr>
</table>
</form>
</div>
</div>
<include file="Public:footer" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/easyui/themes/default/easyui.css">
<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/filter-product.js"></script>
<load href="__PUBLIC__/Js/My97DatePicker/WdatePicker.js" />
<script type="text/javascript">
    function search(){ 
        if ($('#q').val() != "") {
            window.open(APP+'/Product/search?form=form1&field=q&t=hz&keywords='+$('#q').val(),'selected','directorys=no,toolbar=no,status=no,menubar=no,resizable=yes,width=1000,height=800,top=100,left=120,scrollbars=yes');
        }else
            window.open(APP+'/Product/search?form=form1&field=q&t=hz','selected','directorys=no,toolbar=no,status=no,menubar=no,resizable=yes,width=1000,height=800,top=100,left=120,scrollbars=yes');
    }
</script>